<?php

namespace App\Models\Enum;

/**
 * 日期类型
 */
class DataType
{
    // 打款状态
    const ALL = 0;
    const TODAY = 1;
    const YESTERDAY = 2;
    const SEVEN_DAYS = 3;
    const THIRTY_DAYS = 4;
    const HALF_YEAR = 5;

    public static function getName($type)
    {
        switch ($type) {
            case self::ALL:
                return '全部';
            case self::TODAY:
                return '待打款';
            case self::YESTERDAY:
                return '已打款';
            case self::SEVEN_DAYS:
                return '已拒绝';
            case self::THIRTY_DAYS:
                return '打款失败';
            case self::HALF_YEAR:
                return '打款失败';
            default:
                return '类型未定义';
        }
    }

    public static function getAll()
    {
        return [
            self::ALL => self::getName(self::ALL),
            self::TODAY => self::getName(self::TODAY),
            self::YESTERDAY => self::getName(self::YESTERDAY),
            self::SEVEN_DAYS => self::getName(self::SEVEN_DAYS),
            self::THIRTY_DAYS => self::getName(self::THIRTY_DAYS),
            self::HALF_YEAR => self::getName(self::HALF_YEAR),
        ];
    }
}